package com.tuanzi.loan.web.lazy.family;

import com.tuanzi.loan.business.service.family.ProductMatchRuleService;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.family.ProductMatchRuleSearchRequest;
import com.tuanzi.loan.vo.response.family.ProductMatchRuleSearchResponse;
import com.tuanzi.loan.web.bean.CurrentUserBean;
import com.tuanzi.loan.web.lazy.LazyDataSessionModel;
import org.springframework.data.domain.Page;

/**
 * @author Ray 2017/09/21
 */
public class ProductMatchRuleLazyDataModel extends LazyDataSessionModel<ProductMatchRuleSearchRequest, ProductMatchRuleSearchResponse> {

    private static final long serialVersionUID = 9143007553234885156L;

    private ProductMatchRuleService productMatchRuleService;

    public ProductMatchRuleLazyDataModel(ProductMatchRuleSearchRequest searchRequest, CurrentUserBean session, ProductMatchRuleService productMatchRuleService) {
        super(searchRequest, session);
        this.productMatchRuleService = productMatchRuleService;
    }

    @Override
    protected Page<ProductMatchRuleSearchResponse> doLoad0(PageSearcher<ProductMatchRuleSearchRequest> pageSearcher) {
        return productMatchRuleService.list(pageSearcher);
    }
}
